package com.fjec.market.controller;

import com.fjec.common.protocol.JsonResult;
import com.fjec.market.service.IInfoBankTypeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fjec.market.service.IInfoBankService;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author admin
 * @since 2020-10-30
 */
@RestController
@RequestMapping("/")
public class InfoBankController {

    @Resource
    private IInfoBankService service;

    @Resource
    private IInfoBankTypeService bankTypeService;

    /**
     * 根据CityCode查询银行列表
     *
     * @param code
     * @param bankType
     * @return
     */
    @GetMapping("/n/get/bank/by/code")
    public JsonResult getBankByCityCode(String code, String bankType) {
        return service.getBankByCityCode(code, bankType);
    }

    /**
     * 获取所有可用的银行
     *
     * @return
     */
    @GetMapping("/n/get/bank/type")
    public JsonResult getBankType() {
        return bankTypeService.getAllInfoBankType();
    }
}
